<template>
  <div name="order-card">
    <van-popup
      @click-overlay="$emit('update:orderInfo', false)"
      :show="orderInfo"
      round
      position="bottom"
      style="z-index: 3001;"
    >
      <div class="m-10">
        <div style="text-align: right;" class="mb-10">
          <span class=" tipTips" @click="$emit('clear-choose')"
            ><van-icon name="delete" />清空购物袋</span
          >
        </div>
        <div class="shop_card">
          <van-card
            v-for="(item, index) in orderList"
            :key="index"
            tag="特惠"
            :price="item.money.toFixed(2)"
            :origin-price="item.originPrice"
            :desc="item.text"
            :title="item.name"
            :thumb="item.image[0].imgUrl"
          >
            <template #num>
              <van-stepper
                v-model="item.num"
                theme="round"
                @change="$emit('edit-total')"
                min="0"
                max="99"
                button-size="20"
                :integer="true"
              />
            </template>
          </van-card>
        </div>
      </div>
    </van-popup>
  </div>
</template>

<script>
export default {
  props: {
    orderInfo: {
      type: Boolean,
      require: true,
    },
    orderList: {
      type: Array,
      require: true,
    },
  },
};
</script>

<style lang="less" scoped>
.shop_card {
  max-height: 65vh;
  overflow-y: auto;
  padding-bottom: 40px;
  box-sizing: border-box;
}
</style>
